package pers.cj.pdos.service;

import com.baomidou.mybatisplus.extension.service.IService;
import pers.cj.pdos.entity.*;
import pers.cj.pdos.vo.HouseInVo;
import pers.cj.pdos.vo.HouseVo;
import pers.cj.pdos.vo.HouseWaitInVo;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author chenj
 * @since 2020-01-14
 */
public interface IHouseInService extends IService<HouseIn> {

    boolean checkNo(String no, String companyId);

    void insert(HouseIn houseIn, List<HouseInGoods> houseInGoodsList, List<GoodsSn> goodsSnList, List<GoodsSnLog> goodsSnLogList,
                List<HouseInPacket> houseInPacketList,List<HouseInPacketGoods> houseInPacketGoodsList);

    List<HouseInVo> listVo(String companyId,
                           Integer page,
                           Integer limit,
                           Boolean close,
                           Integer type,
                           String search,
                           String no,
                           String linkNo,
                           String goodsName,
                           String remark,
                           String unitName,
                           Date makeTime1,
                           Date makeTime2,
                           String makeUserId,
                           String userStoreId,
                           String userId,
                           Date date1,
                           Date date2,
                           String storeId,
                           String houseId);

    long count(String companyId,
               Boolean close,
               Integer type,
               String search,
               String no,
               String linkNo,
               String goodsName,
               String remark,
               String unitName,
               Date makeTime1,
               Date makeTime2,
               String makeUserId,
               String userStoreId,
               String userId,
               Date date1,
               Date date2,
               String storeId,
               String houseId);

    HouseInVo getVoById(String id);

    List<HouseInVo> listVoByIds(List<String> ids);


    List<HouseInVo> listVoByHouseWaitIn(String houseWaitInId);

    void close(HouseIn houseIn);

    /**
     * 关联单据检查是否有未关闭的入库单
     * @param linkId
     * @return
     */
    boolean checkByLinkId(String linkId);

    boolean checkClose(HouseIn houseIn);

}
